Recently, a dedicated LSI (Large Scale Integration) that performs signal processing by a connecting dedicated coprocessor to an embedded processor core rather than using dedicated hardware becomes widespread to enhance the flexibility of processing. In this case, there arises a need to process a plurality of tasks in one processor core in order to improve the area efficiency. Particularly, in the case of carrying out a plurality of tasks with different properties in one processor core, situations in which a plurality of coprocessors are connected to one processor core will increase.
Typically, in the case of switching tasks, data of a coprocessor and an arithmetic register existing in the coprocessor is temporarily saved. Then, when it is switched back to the original task, the saved data needs to be restored to the arithmetic register.
In most cases, the data save/restore process is performed by the processor core according to an instruction sequence described in software. However, the method requires, each time switching tasks, performing a process of reading data of the current task from the arithmetic register, writing the data into the memory, reading data of the next task from the memory, and writing the data into the arithmetic register, for each of the arithmetic registers. Further, in the case where a plurality of coprocessors are connected, the processor core needs to perform the above process one by one for each of the plurality of coprocessors. As a result, when task switching is done frequently, the overhead caused by the processing time required for the save and restore operation increases. This raises a problem that task switching is difficult in real-time processing.
To solve this problem, Patent Literatures 1 and 2, for example, propose a technique of speeding up the task switching process by distinguishing between tasks using a coprocessor and tasks not using it and skipping saving and restoration of coprocessor context. Further, Patent Literature 3, for example, proposes a technique of speeding up the task switching by saving only the arithmetic register used for the task.
However, even with use of those techniques, when the number of coprocessors used increases, it is necessary to perform the arithmetic register save/restore process for each of the relevant coprocessors at the time of task switching. Further, because task switching is not conducted until the save/restore operation ends, it still takes a long time for task switching.